package com.videoweb.controller;


import com.videoweb.annotation.Anonymous;
import com.videoweb.entity.Tag;
import com.videoweb.entity.dto.UserInfoDTO;
import com.videoweb.entity.vo.UserVo;
import com.videoweb.service.IUserService;
import com.videoweb.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lmr
 * @since 2025-05-17
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    IUserService userService;

//    根据id来得到用户信息   /user/{id}      getUerVo
@GetMapping("/{id}")
public AjaxResult getUserInfoByUserId(@PathVariable("id") Long userId) {

     AjaxResult result =AjaxResult.success();
    UserInfoDTO userInfoDTO = userService.getBaseUserInfo(userId);

return  result.put("userInfo",userInfoDTO);

}


}
